package com.example.aigc_education.domain;


import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("chat_history")
public class ChatHistory implements Serializable {

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long chatId;

    /**
     * 机器id，与二级主题一致
     */
    private Long botId;

    /**
     * 内容
     */
    private String content;

    /**
     * 角色
     */
    private String role;

    /**
     * 状态 0:未发送 1:已发送
     */
    private Integer status;

    /**
     * 创建者
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新者
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public ChatHistory(Long botId, String content, String role) {
        this.botId = botId;
        this.content = content;
        this.role = role;
    }
}
